<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class AddFieldAreaIdsToAdminTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('admin', function (Blueprint $table) {
            $table->unsignedBigInteger('district_id',false)->default(0)->comment('区县id')->after('parent_id');
            $table->unsignedBigInteger('street_id',false)->default(0)->comment('街道id')->after('district_id');
            $table->unsignedBigInteger('community_id',false)->default(0)->comment('社区id')->after('street_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('admin', function (Blueprint $table) {
            $table->dropColumn('district_id');
            $table->dropColumn('street_id');
            $table->dropColumn('community_id');
        });
    }
}
